</head>
<body class="page">
<?php blog_head(); ?>
<div class="container container-page">
	<div class="pageside">
	<div class="pagemenus">
		<ul class="pagemenu">
        <?php if($log_title =="读者排行" || $log_title =="读者墙"):
				($duzhe = "active");
			elseif($log_title =="留言板" || $log_title =="留言"):
				($message = "active");
			elseif($log_title =="广告合作" || $log_title =="广告"):
				($ads = "active");
				elseif($log_title =="联系我们" || $log_title =="联系"):
				($contact = "active");
				elseif($log_title =="投稿" || $log_title =="免费投稿"):
				($tougao = "active");
				elseif($log_title =="关于我们" || $log_title =="关于"):
				($about = "active");
				elseif($log_title =="友情链接" || $log_title =="链接"):
				($links = "active");
				elseif($log_title =="免责声明" || $log_title =="声明"):
				($copyright = "active");
				elseif($log_title =="读者墙" || $log_title =="读者排行"):
				($duzhe = "active");
				elseif($log_title =="文章存档" || $log_title =="文章归档" || $log_title =="归档" || $log_title =="存档"):
				($archives = "active");
				elseif($log_title =="标签云" || $log_title =="标签"):
				($tags = "active");
			endif;
		?>
			<li class="navto-contact <?php echo $message;?>">
            <a href="<?php echo BLOG_URL;?>message">留言板</a></li>
            <li class="navto-ads <?php echo $ads;?>">
            <a href="<?php echo BLOG_URL;?>ads">广告合作</a></li>
            <li class="navto-contact <?php echo $contact;?>">
            <a href="<?php echo BLOG_URL;?>contact">联系我们</a></li>
            <li class="navto-tougao <?php echo $tougao;?>">
            <a href="<?php echo BLOG_URL;?>?plugin=submit">投稿</a></li>
            <li class="navto-about <?php echo $about;?>">
            <a href="<?php echo BLOG_URL;?>about">关于我们</a></li>
            <li class="navto-links <?php echo $links;?>">
            <a href="<?php echo BLOG_URL;?>links">友情链接</a></li>
            <li class="navto-copyright <?php echo $copyright;?>">
            <a href="<?php echo BLOG_URL;?>copyright">免责声明</a></li>
        </ul>
		<ul class="pagemenu">
			<li class="navto-readers <?php echo $duzhe;?>">
            <a href="<?php echo BLOG_URL;?>readers">读者墙</a></li>
            <li class="navto-archives <?php echo $archives;?>">
            <a href="<?php echo BLOG_URL;?>archives">文章存档</a></li>
            <li class="navto-tags <?php echo $tags;?>">
            <a href="<?php echo BLOG_URL;?>tags">标签云</a></li>		
       </ul>
	</div>
</div>	<div class="content">
				<header class="article-header">
			<h1 class="article-title">
            <?php echo $log_title; ?></h1>
		</header>
		<article class="article-content">
			<p><?php echo $log_content; ?></p>
		</article>
		<?php if($log_title =="读者排行" || $log_title =="读者墙"):?>
		<div class="readers">
        <?php
global $CACHE;$user_cache = $CACHE->readCache('user');$name = $user_cache[1]['name'];
$DB = MySql :: getInstance();
$sql = "SELECT count(*) AS comment_nums,poster,mail,url FROM ".DB_PREFIX."comment where date >0 and poster !='". $name ."' and  poster !='匿名' and hide ='n' group by poster order by comment_nums DESC limit 0,280";
$result = $DB -> query( $sql );
$x=1; 
while( $row = $DB -> fetch_array( $result ) )
if ($x<=1) {
{
$img = "<a class=\"item-top item-".$x."\" target=\"_blank\" href=". $row[ 'url' ] ."><h4>【金牌读者】<small>评论：". $row[ 'comment_nums' ] ."</small></h4><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ." src=\"" . TEMPLATE_URL . "img/avatar-default.png\"  class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" /><strong>". $row[ 'poster' ] ."</strong>". $row[ 'url' ] ."</a>";
 if( $row[ 'url' ] )
{$tmp = "<a class=\"item-top item-".$x."\" target=\"_blank\" href=". $row[ 'url' ] ."><h4>【金牌读者】<small>评论：". $row[ 'comment_nums' ] ."</small></h4><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ." src=\"" . TEMPLATE_URL . "img/avatar-default.png\" class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" /><strong>". $row[ 'poster' ] ."</strong>". $row[ 'url' ] ."</a>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}
}elseif($x<=2){
$img = "<a class=\"item-top item-2\" target=\"_blank\" href=". $row[ 'url' ] ."><h4>【银牌读者】<small>评论：". $row[ 'comment_nums' ] ."</small></h4><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ." src=\"" . TEMPLATE_URL . "img/avatar-default.png\"  class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" /><strong>". $row[ 'poster' ] ."</strong>". $row[ 'url' ] ."</a>";
 if( $row[ 'url' ] )
{$tmp = "<a class=\"item-top item-2\" target=\"_blank\" href=". $row[ 'url' ] ."><h4>【银牌读者】<small>评论：". $row[ 'comment_nums' ] ."</small></h4><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ." src=\"" . TEMPLATE_URL . "img/avatar-default.png\"  class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" /><strong>". $row[ 'poster' ] ."</strong>". $row[ 'url' ] ."</a>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}elseif($x<=3){
$img = "<a class=\"item-top item-3\" target=\"_blank\" href=". $row[ 'url' ] ."><h4>【铜牌读者】<small>评论：". $row[ 'comment_nums' ] ."</small></h4><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ." src=\"" . TEMPLATE_URL . "img/avatar-default.png\"  class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" /><strong>". $row[ 'poster' ] ."</strong>". $row[ 'url' ] ."</a>";
 if( $row[ 'url' ] )
{$tmp = "<a class=\"item-top item-3\" target=\"_blank\" href=". $row[ 'url' ] ."><h4>【铜牌读者】<small>评论：". $row[ 'comment_nums' ] ."</small></h4><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ." src=\"" . TEMPLATE_URL . "img/avatar-default.png\"  class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" /><strong>". $row[ 'poster' ] ."</strong>". $row[ 'url' ] ."</a>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}elseif($x>=4){
$img = "";
 if( $row[ 'url' ] )
{$tmp = "<a target=\"_blank\" href=\"". $row[ 'url' ] ."\" title=\"【第".$x."名】 评论：". $row[ 'comment_nums' ] ."\"><img alt='' data-src=".getGravatar( $row[ 'mail' ]) ."  src=\"" . TEMPLATE_URL . "img/avatar-default.png\" class=\"avatar avatar-36 photo\" height=\"36\" width=\"36\" />". $row[ 'poster' ] ."</a>";
}
else
{$tmp = $img;}
$output .= $tmp;
$x++;
}
$output = '
'. $output .'';
echo $output ;
 ?>
   </div>
   <?php elseif($log_title =="留言板" || $log_title =="留言"):?>
   
   <?php elseif($log_title =="广告合作" || $log_title =="广告"):?>

	<?php elseif($log_title =="投稿" || $log_title =="免费投稿"):?>
    
	<?php elseif($log_title =="关于我们" || $log_title =="关于"):?>
			
	<?php elseif($log_title =="友情链接" || $log_title =="链接"):?>
    <?php if(!defined('EMLOG_ROOT')) {exit('error!');} $logurl = Url::log($logid);global $CACHE; $link_cache = $CACHE->readCache('link');?>

			<ul class="plinks">
            	<li class="linkcat">
                <h2>友情链接</h2>
                <ul class="xoxo blogroll">
                <?php foreach($link_cache as $value): ?>
                <li><img class="favicon" width="15px" height="15px" src="<?php echo $value['url']; ?>/favicon.ico"><a href="<?php echo $value['url']; ?>" title="<?php echo $value['des']; ?>" target="_blank"><?php echo $value['link']; ?></a></li>
                <?php endforeach; ?>
                </ul>
                </li>
            </ul>
	<?php elseif($log_title =="免责声明" || $log_title =="声明"):?>

	<?php elseif($log_title =="文章存档" || $log_title =="文章归档" || $log_title =="归档" || $log_title =="存档"):?>
    
	<?php elseif($log_title =="标签云" || $log_title =="标签"):?>
   <?php global $CACHE;
	$tag_cache = $CACHE->readCache('tags');?>
    <div class="tag-clouds">
    <?php foreach($tag_cache as $value): ?>
<a href="<?php echo Url::tag($value['tagurl']); ?>"><?php echo $value['tagname']; ?>(<?php echo $value['usenum']; ?>)</a>
	<?php endforeach; ?>
    </div>
   <?php endif; ?>
   
   <?php blog_comments_post($logid,$ckname,$ckmail,$ckurl,$verifyCode,$allow_remark);?>
    <?php blog_comments($comments,$comnum,$params);?>
</div>
    </div>
</div>
<?php include View::getView('footer');?>